package com.crm.repository;

import com.crm.pojo.BasDict;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface BasDictRepository extends JpaRepository<BasDict, Long> {
    /**
     * 按条件查询指定类型的值
     * @param dicType 数据类型
     * @return 返回一个集合
     * @throws Exception
     */
    public List<BasDict> findBasDictsByDictType(String dicType) throws Exception;

    /**
     * 查询数据类型为销售机会状态的信息
     * @return 返回一个集合
     * @throws Exception
     */
    @Query(value = "select b from BasDict b where b.dictType = '销售机会状态'")
    public List<BasDict> findBasDictsByDictType() throws Exception;
}